/**
 * @author Created by qiush on 2017-05-31.
 */

import * as React from 'react';

import {IAttrRendererProps} from './IAttrRendererProps';

import StringAttrRenderer from './StringAttrRenderer';
import SelectAttrRenderer from './SelectAttrRenderer';
import ColorAttrRenderer from './ColorAttrRenderer';
import ImageAttrRenderer from './ImageAttrRenderer';

export interface IRenderer {
  new(props?: IAttrRendererProps): React.Component<IAttrRendererProps, any | undefined>;
}

interface RendererMap {
  [type: string]: IRenderer;
}

const rendererMap: RendererMap = {
  string: StringAttrRenderer,
  select: SelectAttrRenderer,
  color: ColorAttrRenderer,
  image: ImageAttrRenderer
};

export default rendererMap;
